import Vue from 'vue'
import Vuex from 'vuex'
import about from './modules/about'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    count:1
  },
  mutations: {
    SET_COUNT(state,count){
      state.count=count
    }
  },
  actions: {
    getCount({dispatch}){
      // console.log(context)
      dispatch('about/getNum',null,{root:true})
    }
  },
  getters: {
    getterCount(state,getters,rootState){
      // console.log(state)
      // console.log(getters)
      // console.log(rootState)
      return state.count
    }
  },
  modules: {
    about
  }
})
